package com.pansoft.openplanet.manager;

import com.pansoft.openplanet.constant.IPAssetsConstant;

import java.util.Arrays;

/**
 * 各币种不同交易所的market id
 * @author will
 */
public class CoinMarketIdManager {


    public static String getMarketId(int mode) {
        String marketId = "";
        String site = MarketExchangeSiteManager.getCurrentMarketSite();
        //行情的全网marketId
        if (mode == IPAssetsConstant.CHAIN_ID_BTC) {
            if ("okex.com".equals(site)) {
                marketId = "59";
            } else if ("bithumb".equals(site)) {
                marketId = "97";
            } else if ("zb".equals(site)) {
                marketId = "958";
            } else if ("binance".equals(site)) {
                marketId = "1001";
            } else {
                marketId = "7496";
            }

        } else if (mode == IPAssetsConstant.CHAIN_ID_EOS) {
            if ("okex.com".equals(site)) {
                marketId = "1964";
            } else if ("bithumb".equals(site)) {
                marketId = "5787";
            } else if ("zb".equals(site)) {
                marketId = "965";
            } else if ("binance".equals(site)) {
                marketId = "3829";
            } else {
                marketId = "7505";
            }

        } else {
            if ("okex.com".equals(site)) {
                marketId = "924";
            } else if ("bithumb".equals(site)) {
                marketId = "498";
            } else if ("zb".equals(site)) {
                marketId = "961";
            } else if ("binance".equals(site)) {
                marketId = "1284";
            } else {
                marketId = "7843";
            }
        }
        return marketId;
    }

    /**
     *返回marketid数组
     * @return [7843,7496,7505]
     */
    public static String getMarketIdList() {
        String site = MarketExchangeSiteManager.getCurrentMarketSite();
        String[] marketIdList = new String[3];
        if ("okex.com".equals(site)) {
            marketIdList[0] = "924";
            marketIdList[1] = "59";
            marketIdList[2] = "1964";
        } else if ("bithumb".equals(site)) {
            marketIdList[0] = "498";
            marketIdList[1] = "97";
            marketIdList[2] = "5787";
        } else if ("zb".equals(site)) {
            marketIdList[0] = "961";
            marketIdList[1] = "958";
            marketIdList[2] = "965";
        } else if ("binance".equals(site)) {
            marketIdList[0] = "1284";
            marketIdList[1] = "1001";
            marketIdList[2] = "3829";
        } else {
            marketIdList[0] = "7843";
            marketIdList[1] = "7496";
            marketIdList[2] = "7505";
        }

        return Arrays.toString(marketIdList).replaceAll(" ", "");
    }

}
